g++FLAGS = -g -fpermissive -std=c++11 -Wfatal-errors

all: yzl

yzl: sha256.o base64.o conntrack.o \
      argtable2.o arg_end.o arg_file.o arg_int.o arg_lit.o arg_rem.o arg_str.o \
      firewall.cpp firewall.h common/defines.h common/includes.h
	g++ $(g++FLAGS) sha256.o base64.o conntrack.o \
	    argtable2.o arg_end.o arg_file.o arg_int.o arg_lit.o arg_rem.o arg_str.o \
	    firewall.cpp -lnetfilter_queue -lnetfilter_conntrack -lpthread -lcap -o yzl

sha256.o : sha256/sha256.c sha256/sha256.h sha256/u64.h
	g++ $(g++FLAGS) -c sha256/sha256.c
base64.o : base64.cpp base64.h
	g++ $(g++FLAGS) -c base64.cpp
conntrack.o : conntrack.c conntrack.h
	g++ $(g++FLAGS) -c conntrack.c
argtable2.o : argtable/argtable2.c
	g++ $(g++FLAGS) -c argtable/argtable2.c
arg_end.o : argtable/arg_end.c
	g++ $(g++FLAGS) -c argtable/arg_end.c
arg_file.o : argtable/arg_file.c
	g++ $(g++FLAGS) -c argtable/arg_file.c
arg_int.o : argtable/arg_int.c
	g++ $(g++FLAGS) -c argtable/arg_int.c
arg_lit.o : argtable/arg_lit.c
	g++ $(g++FLAGS) -c argtable/arg_lit.c
arg_rem.o : argtable/arg_rem.c
	g++ $(g++FLAGS) -c argtable/arg_rem.c
arg_str.o : argtable/arg_str.c
	g++ $(g++FLAGS) -c argtable/arg_str.c


clean :
	rm -f  *.o  yzl
